<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

	<!-- h:column cellpadding="0px" cellspacing="0px" margin="0px">
		<f:facet name="header">Card</f:facet>
		<h:panelGrid columns="5" style=" width : 100%; "
			styleClass="#{card.color}"
			columnClasses="twenty, twenty, twenty, twenty, twenty"
			cellpadding="0px" cellspacing="0px">
		</h:panelGrid>
	</h:column -->

	<h:column>
		<f:facet name="header">Card-name</f:facet>
		<h:outputText value="#{card.cardName}" />
	</h:column>
	<h:column>
		<f:facet name="header">Color</f:facet>
		<h:panelGrid styleClass="#{card.color}" style="width:100%">
			<h:outputText value="#{card.color.description}" />
		</h:panelGrid>
	</h:column>
	<h:column>
		<f:facet name="header">Edition</f:facet>
		<h:outputText value="#{card.edition.name}" />
	</h:column>
	<h:column>
		<f:facet name="header">Foil ?</f:facet>
		<h:outputText value="#{card.foil.description}" />
	</h:column>
	<h:column>
		<f:facet name="header">Card type</f:facet>
		<h:outputText value="#{card.type}" />
	</h:column>
	<h:column>
		<f:facet name="header">Col. Nr.</f:facet>
		<h:outputText value="#{card.collectorNumber}" />
	</h:column>

				<h:column rendered="#{identity.loggedIn}">
					<f:facet name="header">Inventory</f:facet>
					<a:form>
						<a:outputPanel id="addCardPopupPanel">
							<a:commandButton value="Add..." reRender="addCardPopupGrid"
								ajaxSingle="true" action="#{inventoryHome.setAddCardId(card.id)}"
								oncomplete="Richfaces.showModalPanel('addCardPopup', {})">
							</a:commandButton>
						</a:outputPanel>
					</a:form>
				</h:column>
				<h:column rendered="#{identity.loggedIn}">
					<f:facet name="header">Inventory</f:facet>
					<a:form>
						<a:outputPanel id="addMultipleToInventoryButtonPanel">
							<a:commandButton id="addMultiple1ToInventoryButton" value="+1"
								reRender="messages" action="#{inventoryHome.addCard(card, 1)}" />
							<a:commandButton id="addMultiple2ToInventoryButton" value="+2"
								reRender="messages" action="#{inventoryHome.addCard(card, 2)}" />
							<a:commandButton id="addMultiple3ToInventoryButton" value="+3"
								reRender="messages" action="#{inventoryHome.addCard(card, 3)}" />
							<a:commandButton id="addMultiple4ToInventoryButton" value="+4"
								reRender="messages" action="#{inventoryHome.addCard(card, 4)}" />
						</a:outputPanel>
					</a:form>
				</h:column>
</ui:composition>